home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 15 / BBS in a box XV-1.iso / Files / Tele / P / ProTERM Demo 1.01.sit / ProTERM Demo 1.01 / Macros / Macro.Delphi < prev    next >
Encoding:
Text File  |  1994-12-29  |  992 b   |  57 lines  |  [TEXT/PTM1]

  1. /*
  2. Delphi AutoScan macro for ProTERM
  3.  
  4. To use this macro, add the command: EXTERN(":Macros:Macro.Delphi",main());
  5. to the end of your Delphi logon macro, prior to the END; command.
  6. */
  7.  
  8. INT stat;
  9.  
  10. IF (WT("Mail","Hello") == 1) {
  11.  WT("logon at");
  12.  prompt();
  13.  
  14.  prompt();
  15.  PR("GO MAIL MAIL^m");
  16.  prompt();
  17.  PR("DIR/NEW^M");
  18.  prompt();
  19.  PR("READ/NEW^M");
  20.  WHILE(1) {
  21.   stat = WT(1500, "MAIL> ", "No more messages");
  22.   IF (stat == 2) { WT("MAIL> "); }
  23.   IF (WT(100,"")) { CONTINUE; }
  24.   IF (stat != 1) { BREAK; }
  25.   PR("^M");
  26.  }
  27.  PR("EXIT^M");
  28. }
  29.  
  30. prompt();
  31. PR("go comp mac forum^M");
  32. prompt();
  33. PR("dir new^M");
  34. prompt();
  35. PR("read new follow ns^M");
  36. prompt();
  37. PR("bye^M");
  38. WT(300);
  39. UI_MENU("Online:Disconnect");
  40. UI_CLICK("OK");
  41. RETURN();
  42.  
  43. //
  44. // special function to detect a prompt
  45. //
  46. // waits for a prompt character followed by "no activity"
  47. // to avoid detecting the prompt within a stream of data.
  48. //
  49. FUNC prompt()
  50. {
  51.  WHILE(1) {
  52.   WT(500, "> ", ": ", "? ");
  53.   IF (!WT(100,"")) { BREAK; }
  54.  }
  55.  RETURN;
  56. }
  57.